package com.min.oss.config;

import com.min.oss.service.LocalService;
import com.min.oss.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@EnableConfigurationProperties(OssProperties.class)
@Import(cn.hutool.extra.spring.SpringUtil.class)
public class OssConfigure {

    @Autowired
    OssProperties properties;

    @Bean
    @ConditionalOnMissingBean
    StorageService objectStorage() {
        return new LocalService();
    }

}
